<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
    //传值调用
    function fun1(str){
        str = '你好';
    }
    var a = 'hello';        //字符串类型
    fun1(a);
    document.write('传值调用，a='+a);

    document.write('<br/>');

    //传址调用
    function fun2(person){
        person.name='李四';
    }
    var b = {name:'张三'};
    fun2(b);
    document.write('传址调用,person.name='+b.name);

  </script>
 </body>
</html>
